home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Extensions… / Extension Shell multi-seg ƒ / Extension.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-10  |  2.4 KB  |  87 lines  |  [TEXT/MPS ]

  1. /*________________________________________________________
  2.  
  3.     File: Extension.h
  4.  
  5.     C header file for a printing extension.
  6.  
  7.     Dave Hersey
  8.     Apple Developer Technical Support
  9.  
  10.     12/01/92 - dmh - Created.
  11.      4/26/93 - dmh - Updated to use recommended approach
  12.                       to global data initialization.
  13.      9/05/93 - dmh - Updated for b2.
  14.                     - Fixed minor problem with highlighting
  15.                      of editText panel items.
  16.                    - Switched to Exception.h assertion stuff
  17.                      for error checking.
  18.     12/18/93 - dmh - Updated for b3.
  19.      3/22/94 - dmh - Updated for b4.
  20.      6/10/94 - dmh - Added GXPRINTINGDISPATCH examples.
  21.  
  22.     (Note: labels are in the Mark menu.)
  23.     
  24. __________________________________________________________*/
  25.  
  26. #include <Types.h>
  27. #include <Errors.h>
  28. #include <Resources.h>
  29. #include <ToolUtils.h>
  30. #include <GXExceptions.h>
  31. #include <Collections.h>
  32. #include <Messages.h>
  33. #include <PrintingManager.h>
  34. #include <PrintingMessages.h>
  35.  
  36.  
  37. #define kCreator                    'GMUL'            /* Our creator type.            */
  38. #define kExtensionCollectionType    kCreator        /* The collection type we use.    */
  39.  
  40. #define r_ExtensionPanel            6000            /* The ID of our dialog panel.    */
  41. #define kExtensionTurnedOff            0                /* We're turned on.                */
  42. #define kExtensionTurnedOn            1                /* We're turned off.            */
  43.  
  44. #define kDefaultSetting            kExtensionTurnedOn    /* We're on by default.            */
  45.  
  46.  
  47. typedef struct ExtensionCollection                    /* This is our collection type.    */
  48. {
  49.     char    extTurnedOn;                            /* On/off panel item value.        */
  50.     char    fillByte;
  51. } ExtensionCollection;
  52.  
  53.  
  54. // Prototypes:
  55.  
  56. extern    long A5Size (void);                            /* We need these to set up        */
  57. extern    void A5Init (void *);                        /* our A5 world.                */
  58.  
  59. OSErr    InitGlobalData(void);
  60. OSErr    NewInitialize(void);
  61. OSErr    NewShutDown(void);
  62. OSErr    NewSpoolPage(gxSpoolFile spFile, gxFormat aFormat, gxShape pgShape);
  63. OSErr    NewJobPrintDialog(gxDialogResult *dlogResult);
  64. OSErr    NewHandlePanelEvent(gxPanelInfoRecord *panelInfo);
  65.  
  66.  
  67. // GXPRINTINGDISPATCH examples.  Note these routines must return an OSErr result.
  68. // Two routines are "dispatched," both residing in 'pext' segment #1.
  69.  
  70. #ifdef SECOND_SEG
  71.  
  72. OSErr    SetUpPrintPanel(void);
  73.  
  74. OSErr    GetJobCollectionItem(void *collectItem, long *collectSize,
  75.                              OSType collectType, short collectID);
  76.  
  77. #else
  78.  
  79. OSErr SetUpPrintPanel(void)
  80.         = GXPRINTINGDISPATCH(1, 1);
  81.  
  82. OSErr    GetJobCollectionItem(void *collectItem, long *collectSize,
  83.                              OSType collectType, short collectID)
  84.         = GXPRINTINGDISPATCH(1, 2);
  85.  
  86. #endif SECOND_SEG
  87.